#include "Output.h"

void Output::PrintMap(const Map& MapInstance)
{
    PrintTitle();

    int Row = MapInstance.size();
    int Col = MapInstance[0].size();
    for (int i = 0; i < Row; ++i)
    {
        for (int j = 0; j < Col; ++j)
        {
            std::cout << Convert(MapInstance[i][j]);
        }
        std::cout << std::endl;
    }
}

char Output::Convert(ObjectType Type)
{
    switch (Type)
    {
    case EMPTY:
        return ' ';
    case WALL:
        return gWallSymbol;
    case BOX:
        return gBoxSymbol;
    case PLAYER:
        return gPlayerSymbol;
    case ENDZONE:
        return gEndZoneSymbol;
    case BOX_AT_ENDZONE:
        return gBoxAtEndZoneSymbol;
    default:
        return '\0';
    }
}
